package com.beaut.project.control;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.beaut.project.service.OaService;



/**
 * oa办公管理
 * @author xf
 *
 */
@Controller
@RequestMapping("/oa")
public class OaController extends BaseControl{
	@Autowired
	private OaService oaService;
	
	@RequestMapping(value = "/listPageLeave", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageWareHouse(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMap(request));
    	return oaService.listPageLeave(map);
    }
	@RequestMapping(value = "/getLeaveById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
	public @ResponseBody String getLeaveById(HttpServletRequest request) {
		return oaService.getLeaveById(requestParameterToMap(request));
	}
	@RequestMapping(value = "/addLeave", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody String addLeave(HttpServletRequest request) {
		return oaService.addLeave(requestParameterToMap(request));
	}
	@RequestMapping(value = "/updateLeave", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody String updateSupplier(HttpServletRequest request) {
		return oaService.updateLeave(requestParameterToMap(request));
	}
	@RequestMapping(value = "/deleteLeave", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody String deleteLeave(HttpServletRequest request) {
		return oaService.deleteLeave(requestParameterToMap(request));
	}
}
